Dynomotion

Group: DynoMotion Message: 6779 From: Henk Sterk Date: 2/21/2013
Subject: Matrix Keypad HMI Code
Hi Tom,
 
Just finished a HMI with build in MPG to trigger macro's and the likes, it has 40+ buttons and 16 LED's. The push buttons are arranged in a matrix, with 8 rows and 6 columns. The rows are connected to the output on  JP12 (160-167) and the columns on the input (128-135) on the JP12 (via pull-down 1K), all works fine, however,
I'm struggling putting some code together.
 
Can you give me some pointers, or do you have an example I can use?
 
Many thanks
 
Henk
Group: DynoMotion Message: 6784 From: Tom Kerekes Date: 2/21/2013
Subject: Re: Matrix Keypad HMI Code
Attachments :
Hi Henk,

See the attached program.  It is written as a state machine so that it is non-blocking so that it can be periodically serviced quickly and not require a Thread for the whole time it takes to perform a scan.

But it only is written to allow one key to be pushed at a time (which is probably a requirement anyway?).

HTH
Regards
TK


Group: DynoMotion Message: 6785 From: Henk Sterk Date: 2/21/2013
Subject: Re: Matrix Keypad HMI Code [1 Attachment]
Hi Tom,

This looks great, let me play around with it, yes I only assume one key press at the time.

Many thanks again for the great service.

Regards,

Henk



On Friday, February 22, 2013, Tom Kerekes wrote:
 
[Attachment(s) from Tom Kerekes included below]

Hi Henk,

See the attached program.  It is written as a state machine so that it is non-blocking so that it can be periodically serviced quickly and not require a Thread for the whole time it takes to perform a scan.

But it only is written to allow one key to be pushed at a time (which is probably a requirement anyway?).

HTH
Regards
TK